﻿/********************************************************************************************
 * 文件名称: CatalogInfo.cs
 * 设计人员: 严向晖 （yanxianghui@gmail.com）
 * 设计时间: 2010/1/13
 * 功能描述: 
 * 注意事项: 
 * 版权所有: Copyright (c) 2010, Fujian SIRC
 * 修改记录:       修改时间     人员     修改备注
 *	----------	   --------		-----     -----------------------------------------
 * 
 ********************************************************************************************/

using System;
using Shanfree.Framework.Utility;

namespace Shanfree.SharpMovie.Model
{
    /// <summary>
    /// 实体类CatalogInfo 。(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Persistence(IsPrimaryKey = false, ColumnName = "Catalog")]
    [Serializable]
    public class CatalogInfo : ITreeNode
    {
        /// <summary>
        /// 默认的根结点ID
        /// </summary>
        public const string DEFAULT_PARENT_ID = "-1";

        public CatalogInfo()
        {

        }

        public CatalogInfo(string id)
        {
            this.ID = id;
        }

        #region 持久化字段
        private string _id;
        /// <summary>
        /// 目录主键
        /// </summary>
        [Persistence(IsPrimaryKey = true, ColumnName = "ID")]
        public string ID
        {
            set
            {
                _id = value;
            }
            get
            {
                return _id;
            }
        }
        /// <summary>
        /// 栏目父级ID,默认为-1
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "ParentID")]
        public string ParentID { get; set; }

        private string _name;
        /// <summary>
        /// 目录名称
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "Name")]
        public string Name
        {
            set
            {
                _name = value;
            }
            get
            {
                return _name;
            }
        }
        private string _code;
        /// <summary>
        /// 目录编码
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "Code")]
        public string Code
        {
            set
            {
                _code = value;
            }
            get
            {
                return _code;
            }
        }
        private string _remark;
        /// <summary>
        /// 备注
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "Remark")]
        public string Remark
        {
            set
            {
                _remark = value;
            }
            get
            {
                return _remark;
            }
        }
        private string _url;
        /// <summary>
        /// URL
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "URL")]
        public string URL
        {
            set
            {
                _url = value;
            }
            get
            {
                return _url;
            }
        }
        /// <summary>
        /// 排序号
        /// </summary>
        [Persistence(IsPrimaryKey = false, ColumnName = "SortNum")]
        public int SortNum { get; set; }

        #endregion 持久化字段

    }
}

